<template>
	<div id="bigNumberID">
		<nuxt-link to="/">回index</nuxt-link>
		<div>测试bigNumber的使用</div>
		<div class="col">x:{{bigNumberObj.x}}</div>
		<div>y:{{bigNumberObj.y}}</div>
		<div>y:{{bigNumberObj.z}}</div>
	</div>
</template>

<script setup>
	const {
		$BigNumber
	} = useNuxtApp()
	const x = new $BigNumber(0.1);
	const y = x.plus(0.2);
	const z = $BigNumber(0.7).plus(x).plus(y).toFixed(2);
	// console.log(0.1 + 0.2);
	// console.log(y.toString());
	// console.log(z.toString());
	const bigNumberObj = reactive({
		x: x,
		y: y,
		z: z
	})
	const nine = () => {
		for (var i = 1; i <= 9; i++) {
			var row = '';
			for (var j = 1; j <= i; j++) {
				row += j + '×' + i + '=' + (i * j) + '\t';
			}
			// console.log(row);
		}
	}
	nine()
</script>

<style lang="scss">
	#bigNumberID {
		.col {
			font-size: 24px;
		}
	}
</style>